#!usr/bin/python3
import sys
import getopt
import os
import shutil

"""
递归删除目标文件
"""

def main(argv):
    originPath = argv[0]  # 原始路径
    print("打开路径", originPath)


    for dirpath, dirnames, filenames in os.walk(originPath):
        for file in filenames:
            if os.path.splitext(file)[1] in [".xml"]:
                currentPath = os.path.join(dirpath, file)
                print("文件为",currentPath)
                os.remove(currentPath)
                


if __name__ == "__main__":
    main(sys.argv[1:])
